package com.hama.iotrust.common.util;

import java.io.FileOutputStream;
import java.io.OutputStream;

public class IoUtil {
	
	public static  boolean TurnFile(byte[] fileData, String path) {
		try {
			// Base64解码
			for (int i = 0; i < fileData.length; ++i) {
				if (fileData[i] < 0) {// 调整异常数据
					fileData[i] += 256;
				}
			}
			// 生成jpeg图片
			OutputStream out = new FileOutputStream(path);
			out.write(fileData);
			out.flush();
			out.close();
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}

	}
	
	

}
